package com.beecloud.learning.charpter.one;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * Created with IntelliJ IDEA.
 * User: hengsun
 * Date: 3/23/17
 * Time: 3:45 PM
 * Description:
 */
public class UnsafeSequence {
    private static AtomicInteger value = new AtomicInteger(0);

    public  int getNext(){
        //synchronized(value)  {
        value.set(value.get() + 1);
            return value.get();
        //}
    }
}
